package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @package com.leyou.item.mapper
 * @description: 通用mapper：查询后台商品分类
 * @author: 许超越
 * @date 2019/6/23 14:59
 * @version: V1.0
 */
public interface CategoryMapper extends BaseMapper<Category> {

    /**
     * 根据品牌id查询商品类目
     * @param: bid
     * @return
     */
    List<Category> queryByBrandId(@Param("bid") Long bid);


    /**
     * 通过品牌id删除中间表
     * @param bid
     * @return
     */
    int deleteIntermediateByBrandId(@Param("bid") Long bid);

    /**
     * 计算中间表中品牌和类目的数量
     * @param bid
     * @return
     */
    int queryCountByBrandId(@Param("bid") Long bid);
}
